<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jstl/fmt_rt"%>
<%@taglib uri="http://wdd.authority.tag" prefix="authority" %>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://"
			+ request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>
<c:set var="ctx"  value="<%=basePath%>" />
<link rel="Bookmark" href="<%=basePath%>/images/favicon/favicon.ico" >
<link rel="Shortcut Icon" href="<%=basePath%>/images/favicon/favicon.ico" />
<style type="text/css">



</style>
<%--<link rel="stylesheet" type="text/css" href="<%=basePath%>backstage/aliIconfont/demo.css">--%>
<style type="text/css">
	@font-face {font-family: "iconfont";
		src: url('<%=basePath%>backstage/aliIconfont/iconfont.eot'); /* IE9*/
		src: url('<%=basePath%>backstage/aliIconfont/iconfont.eot?#iefix') format('embedded-opentype'), /* IE6-IE8 */
		url('<%=basePath%>backstage/aliIconfont/iconfont.woff') format('woff'), /* chrome, firefox */
		url('<%=basePath%>backstage/aliIconfont/iconfont.ttf') format('truetype'), /* chrome, firefox, opera, Safari, Android, iOS 4.2+*/
		url('<%=basePath%>backstage/aliIconfont/iconfont.svg#iconfont') format('svg'); /* iOS 4.1- */
	}
	.iconfont{
		font-family:"iconfont" !important;
		font-size:16px;font-style:normal;
		-webkit-font-smoothing: antialiased;
		-webkit-text-stroke-width: 0.2px;
		-moz-osx-font-smoothing: grayscale;
	}
	.layui-layer-title{
		 background-color: #009E96 !important;
		 color: white !important;
	 }
	.layui-layer-setwin a{
		color: white !important;
	}

</style>


<script type="text/javascript" src="<%=basePath%>common/frame/layui/layui.js"></script>
<script>

function Wh(w, h,w2,h2) {
	var heigth=0, width=0,top=250;
	if (h > 1700 || w > 1700) {
		heigth = h / 3;
		width = w / 3;
	} else if (h > 1500 || w > 1500) {
		heigth = h / 2.5;
		width = w / 2.5;
	} else if (h > 1300 || w > 1300) {
		heigth = h / 2;
		width = w / 2;
	} else if (h > 1200 || w > 1200) {
		heigth = h / 1.84;
		width = w / 1.84;
	} else if (h > 1000 || w > 1000) {
		heigth = h / 1.84;
		width = w / 1.84;
	} else if (h > 800 || w > 800) {
		heigth = h / 1.23;
		width = w / 1.23;
	} else if (h > 700 || w > 700) {
		heigth = h / 1.1;
		width = w / 1.1;
	}else{
		heigth=600; width=w*(heigth/h);
	}
	
	
	if(heigth>=650){
		heigth=650; width=w*(heigth/h);
	}
	if(heigth>=650){
		top = 50;
	}else if(heigth>=500){
		top = 100;
	}else if(heigth>=400){
		top = 150;
	}else if(heigth>=300){
		top = 200;
	}
	

	if(width>w2 && heigth<h2){
		var ww = width;
		width = w2/1.2;
		heigth = heigth*(width/ww);
	}
	if(width<w2 && heigth+100>h2){
		var hh = heigth;
		heigth = h2/1.2;
		width = width*(heigth/hh);
		top = 50;
	}
	var myArray = new Array();
	myArray.push(width);
	myArray.push(heigth);
	myArray.push(top);
	return myArray;
}


function myConfirm(title,jsonData,url,layui,table,now){
    layui.layer.confirm(title+"，确认吗？", {
        icon: 3,
        skin: 'larry-green',
        title: "系统提示",
        offset: '200px',
        closeBtn: 0,
        skin: 'layui-layer-molv',
        anim: Math.ceil(Math.random() * 6),
        btn: ['确定', '取消']
    }, function (index) {
        layui.jquery.ajax({
            url: '<%=basePath%>'+url,
            type: 'post',
            async: false,
            data: jsonData,
            dataType: "json",
            success: function (data) {
                if (data.state == 200) {
                    layui.layer.msg(data.message, {icon: 6});
                    if(now !=undefined && now != "" && now == "pageNumber"){
                        layui.jquery(".layui-laypage-btn").click();
					}else{
                        table.reload();
					}

                    return true;
                } else {
                    layui.layer.msg(data.message, {icon: 5});
                    return false;
                }
            }, error: function () {
                top.layer.msg("系统数据处理异常！", {icon: 2});
                return false;
            }
        });
        layer.close(index);
    }, function (index) {

        layer.close(index);
    });
}

function myOpen(title,top,width,height,layUi,json,url){
	var parms = "";
	if(null == json || ""==json || undefined == json || json.length == 0 ){
		parms="";
	}else{
	    var i = 0;
        for(var j in json){//遍历json对象的每个key/value对,p为key
			if(i==0){
                parms +="?"+j+"="+json[j];
			}else{
                parms +="&"+j+"="+json[j];
			}
			i ++;
        }
        i = 0;
	}
/*   var open = layui.layer.open({*/
    layUi.layer.open({
        title: title,
        type: 2,
        move: false,
        anim: 1,
        skin: "larry-green",
        offset: top+'px',
        area: [width+ "px", height + "px"],
        content: "<%=basePath%>"+url+parms
    });
}


function dateDiff(startTime, endTime, diffType) {
    if(diffType=="" || diffType==undefined){
        diffType ="minute";
    }
    //将xxxx-xx-xx的时间格式，转换为 xxxx/xx/xx的格式
    // startTime = startTime.replace(/\-/g, "/");
    // endTime = endTime.replace(/\-/g, "/");
    //将计算间隔类性字符转换为小写
    diffType = diffType.toLowerCase();
    var sTime =new Date(startTime); //开始时间
    var eTime =new Date(endTime); //结束时间
    //作为除数的数字
    var timeType =1;
    switch (diffType) {
        case"second":
            timeType =1000;
            break;
        case"minute":
            timeType =1000*60;
            break;
        case"hour":
            timeType =1000*3600;
            break;
        case"day":
            timeType =1000*3600*24;
            break;
        default:
            break;
    }
    return parseInt((eTime.getTime() - sTime.getTime()) / parseInt(timeType));
}
function dateFtt(fmt,date)
{ //author: meizz
    var o = {
        "M+" : date.getMonth()+1,                 //月份
        "d+" : date.getDate(),                    //日
        "h+" : date.getHours(),                   //小时
        "m+" : date.getMinutes(),                 //分
        "s+" : date.getSeconds(),                 //秒
        "q+" : Math.floor((date.getMonth()+3)/3), //季度
        "S"  : date.getMilliseconds()             //毫秒
    };
    if(/(y+)/.test(fmt))
        fmt=fmt.replace(RegExp.$1, (date.getFullYear()+"").substr(4 - RegExp.$1.length));
    for(var k in o)
        if(new RegExp("("+ k +")").test(fmt))
            fmt = fmt.replace(RegExp.$1, (RegExp.$1.length==1) ? (o[k]) : (("00"+ o[k]).substr((""+ o[k]).length)));
    return fmt;
}

//数据处理完成刷新父页面
function closeIframe(current,loading){
    var index = parent.layer.getFrameIndex(window.name); //当前iframe层的索引
    parent.layer.close(index); //再执行关闭
	if(current){//刷新当前父页页面
        var father = parent.layui.jquery;
        if(father(".layui-laypage-btn")[0]!=undefined){
            father(".layui-laypage-btn")[0].click();
        }else{
            father("#getSelect").click();
        }
	}else{//直接刷新父页到第一页
        parent.location.reload();//刷新父页面
	}
	if(undefined!=loading || loading!=""){
        top.layer.close(loading);
	}

}

//刷新当前页
function fatherReload(){
    layui.jquery(".layui-laypage-btn").click();
}


function isBrowser() {
    var userAgent = navigator.userAgent; //取得浏览器的userAgent字符串
    var isOpera = userAgent.indexOf("Opera") > -1; //判断是否Opera浏览器
    var isIE = userAgent.indexOf("compatible") > -1 && userAgent.indexOf("MSIE") > -1 && !isOpera; //判断是否IE浏览器
    var isEdge = userAgent.indexOf("Windows NT 6.1; Trident/7.0;") > -1 && !isIE; //判断是否IE的Edge浏览器
    var isFF = userAgent.indexOf("Firefox") > -1; //判断是否Firefox浏览器
    var isSafari = userAgent.indexOf("Safari") > -1 && userAgent.indexOf("Chrome") == -1; //判断是否Safari浏览器
    var isChrome = userAgent.indexOf("Chrome") > -1 && userAgent.indexOf("Safari") > -1; //判断Chrome浏览器

    if (isIE){
        var reIE = new RegExp("MSIE (\\d+\\.\\d+);");
        reIE.test(userAgent);
        var fIEVersion = parseFloat(RegExp["$1"]);
        if(fIEVersion == 7)
        { return "IE7";}
        else if(fIEVersion == 8)
        { return "IE8";}
        else if(fIEVersion == 9)
        { return "IE9";}
        else if(fIEVersion == 10)
        { return "IE10";}
        else if(fIEVersion == 11)
        { return "IE11";}
        else
        { return "0"}//IE版本过低
    }//isIE end
    if (isFF) { return "FF";}
    if (isOpera) { return "Opera";}
    if (isSafari) { return "Safari";}
    if (isChrome) { return "Chrome";}
    if (isEdge) { return "Edge";}
}

function getRootPath(){
    //获取当前网址，如： http://localhost:8083/uimcardprj/share/meun.jsp
    var curWwwPath=window.document.location.href;
    //获取主机地址之后的目录，如： uimcardprj/share/meun.jsp
    var pathName=window.document.location.pathname;
    var pos=curWwwPath.indexOf(pathName);
    //获取主机地址，如： http://localhost:8083
    var localhostPath=curWwwPath.substring(0,pos);
    //获取带"/"的项目名，如：/uimcardprj
    var projectName=pathName.substring(0,pathName.substr(1).indexOf('/')+1);
    return(localhostPath+projectName+"/");
}

/**确定键触发点击事件*/
function enter(key){
   // alert(key);
    document.onkeydown = function(e){
        var ev =document.all ? window.event : e;
        if(ev.keyCode==13) {
            layui.jquery("#"+key).click();
        }
    }
}

/**下拉按钮事件*/
function downPanel(that) {
    var nodes = layui.jquery(".layui-form-selected");
    var hoverNodes = layui.jquery(".over-hover");
    var current = layui.jquery(that).parent();
    if (current.hasClass("layui-form-selected")) {
        nodes.removeClass("layui-form-selected");
        hoverNodes.removeClass("over-hover");
    } else {
        if (nodes.length > 0) {
            nodes.removeClass("layui-form-selected");
            hoverNodes.removeClass("over-hover");
		}
        current.addClass("layui-form-selected");
        current.parent(".layui-form").parent().addClass("over-hover");
    }

    layui.jquery(document).click(function(event){
        var _con2 = layui.jquery(".down-panel");
        if(!_con2.is(event.target) && (_con2.has(event.target).length ===0)){
            _con2.removeClass("layui-form-selected");
			hoverNodes.removeClass("over-hover");
			nodes.removeClass("layui-form-selected");
        }
    });
}
</script>